home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / transpor / ifmail23.z / ifmail23 / ifmail / ifcico / dial.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-09  |  641 b   |  35 lines

  1. #include <unistd.h>
  2. #include <stdio.h>
  3. #include "lutil.h"
  4. #include "nodelist.h"
  5. #include "config.h"
  6.  
  7. int chat(node*,modem_string*,modem_string*,modem_string*,int,char*);
  8.  
  9. int dialphone(nlent,phone)
  10. node *nlent;
  11. char *phone;
  12. {
  13.     int rc;
  14.  
  15.     debug(18,"dialing %s",phone);
  16.     rc=chat(nlent,modemreset,modemok,modemerror,3,phone);
  17.     if (rc)
  18.     {
  19.         logerr("could not reset the modem");
  20.         return rc;
  21.     }
  22.     rc=chat(nlent,modemdial,modemconnect,modemerror,70,phone);
  23.     if (rc) loginf("could not connect to the remote");
  24.     return rc;
  25. }
  26.  
  27. int hangup(nlent)
  28. node *nlent;
  29. {
  30.     debug(18,"hanging up");
  31.     chat(nlent,modemhangup,NULL,NULL,0,NULL);
  32.     sleep(1);
  33.     return 0;
  34. }
  35.